<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use backend\utils\XHtml;

/* @var $this yii\web\View */
/* @var $val common\models\Config */

$this->title = '基本设置';
$this->params['breadcrumbs'][] = ['label' => '站点配置', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="page-create">
    <div class="box box-primary">
        <div class="box-body">

            <?= $this->render('/site/error-summary', ['model' => $model]) ?>

            <?php $form = ActiveForm::begin(['options' => ['class' => 'form-horizontal']]); ?>

            <?php foreach ((array)$config as $val) { ?>
                <div class="form-group">
                    <label class="col-lg-2 control-label"><?= $val->name ?></label>
                    <div class="col-lg-10">
                        <?= XHtml::createByConfig($val->variable, $val->value, $val->type, $val->type_data ? json_decode($val->variable) : []) ?>
                    </div>
                </div>
            <?php } ?>

            <div class="form-group">
                <label class="col-sm-2 control-label"></label>
                <?= XHtml::submitButton('保存') ?>&nbsp;&nbsp;
                <?= XHtml::resetButton() ?>
            </div>
            <?php ActiveForm::end(); ?>
        </div>
    </div>
</div>